<?php

namespace App\Http\Middleware;

use Closure;

class RegisterMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {

//        在中间件里判断如果未激活就跳到那个页面,在中间件里进行判断
        if (auth()->check() && !auth()->user()->status){

            return redirect()->route('zhuce');
        }
        return $next($request);
    }
}
